﻿using System.ComponentModel.DataAnnotations;
using ApiLib.AppStart;
using SqlSugar;

namespace ApiLib.Models;

/// <summary>
/// 评论
///</summary>
[Tenant(GlobalConstants.MainDbConfigId), SugarTable("sys_comment_info")]
public class SysCommentInfo
{
    /// <summary>
    ///  
    ///</summary>
    [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
    public int Id { get; set; }

    /// <summary>
    /// 评论类型 
    ///</summary>
    [SugarColumn(ColumnName = "data_type")]
    public string DataType { get; set; } = "WorkOrder";

    /// <summary>
    /// 评论类型ID 
    ///</summary>
    [SugarColumn(ColumnName = "data_id")]
    public int DataId { get; set; }

    /// <summary>
    /// 回复的评论ID 
    ///</summary>
    [SugarColumn(ColumnName = "replay_id")]
    public int ReplayId { get; set; }

    /// <summary>
    /// 回复的评论
    ///</summary>
    [SugarColumn(ColumnName = "replay_user")]
    public string ReplayUser { get; set; }
    //todo v5 replay=>reply
    
    
    /// <summary>
    /// 回复的评论
    ///</summary>
    [SugarColumn(IsIgnore = true)]
    public string ReplayUserName { get; set; }

    /// <summary>
    /// 内容 
    ///</summary>
    [SugarColumn(ColumnName = "content")]
    [Required(ErrorMessage = "不能为空")]
    [Display(Name = "评论内容")]
    public string Content { get; set; }

    /// <summary>
    /// 附件 
    ///</summary>
    [SugarColumn(ColumnName = "annexs")]
    public string Annexs { get; set; }

    /// <summary>
    ///  
    ///</summary>
    [SugarColumn(ColumnName = "create_user")]
    public string CreateUser { get; set; }

    /// <summary>
    ///  
    ///</summary>
    [SugarColumn(IsIgnore = true)]
    public string CreateUserName { get; set; }

    /// <summary>
    ///  
    ///</summary>
    [SugarColumn(ColumnName = "create_time",InsertServerTime = true)]
    public DateTime CreateTime { get; set; }
}